#!/usr/bin/env python
# coding=utf-8
"""WTFM"""
import argparse
import requests

TOKEN = "2025426c-ea1d-4d17-ba1e-207cbf7753d6"
URL = "https://dmp.cn.miaozhen.com/api/v1/data/tag/sven"


def main():
    arg_parser = argparse.ArgumentParser(
        description="用于请求一下dmp网站, 启动标签数据源计算的后门")

    arg_parser.add_argument("tenant_id", type=int, default=4, help="租户id")
    arg_parser.add_argument("ds_id", type=int, default=1, help="标签数据源id")
    args = arg_parser.parse_args()
    start_tag_ds_job(args.tenant_id, args.ds_id)


def start_tag_ds_job(tenant_id, ds_id):
    payload = {'token': TOKEN, 'tenant_id': tenant_id, "dataSource_id": ds_id}
    print(payload)
    response = requests.post(URL, data=payload)
    print(response.text)
    print(response.status_code)


if __name__ == '__main__':
    main()
